

import { hex_sha1 } from "@/assets/js/sha1.js";


export  function sign(uri) {
    let params = new FormData();
    let totke="F8D1D999B8AF9EA32A09A7D8985F016E",stime= parseInt(new Date().getTime()/1000);
    params.append("apiToken",totke);
    params.append("stime",stime);
    let s = hex_sha1("apiToken="+totke+"&stime="+stime+"&uri="+uri)
    params.append("sign",s);
    return params;
};

export  function signStr(uri) {
    let totke="F8D1D999B8AF9EA32A09A7D8985F016E",stime= parseInt(new Date().getTime()/1000);
    let s = hex_sha1("apiToken="+totke+"&stime="+stime+"&uri="+uri);
    let params = "apiToken="+totke+"&stime="+stime+"&sign="+s;
    return params;
};